<!-- 不需要外层card的自定义表单 -->
<template>
  <view v-if="previewVisible">
    <template v-for="el in columns[props.formId]" :key="el.prop">
      <!-- 此处预留后期不需要card类型的自定义表单，添加title -->
      <customFormShow
        v-if="el.list.some((i: any) => i.visibleFlag)"
        :form-id="props.formId"
        :file-feild-list="fileFeildList"
        :columns="el.list"
        :data="formDetailList[props.formId]"/>
    </template>
  </view>
</template>
<script setup lang="ts">
import customFormShow from './customFormShow.vue'
import { getFormInfo } from './getFormInfo'
const props = defineProps<{
  formId: string
  // 查询接口所需字段
  queryValueFlag?:number
}>()
  
const columns = ref<any>({});
const formDetailList = ref<any>({});
const fileFeildList = ref<any[]>([]);
const previewVisible = ref(false)
const review = () => {
  previewVisible.value = false
  const params: any = {
    formId: props.formId,
    queryValueFlag: props.queryValueFlag
  }
  getFormInfo(params).then((res: any) => {
    columns.value = res.columns.value
    formDetailList.value = res.formDetailList.value
    fileFeildList.value = res.fileFeildList.value
    previewVisible.value = res.previewVisible.value
  })
}
review()
</script>